home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: November, 1999
- // Author: divin
- //
- //
- // Procedure Name:
- // blendGraphEdit
- //
- // Description:
- // Creates a graph editor for the given blend curve.
- //
- //
- // Input Arguments:
- // $blendName - The name of the curve to show in the editor.
- // $updateOnly - Whether or not the editor should only update
- // its selection if the editor already exists.
- //
- // Return Value:
- // None.
- //
-
- global proc blendGraphEdit(string $blendName, int $updateOnly)
- {
- string $win = ($blendName + "GraphWindow");
- string $form = ($blendName + "GraphForm");
- string $ed = ($blendName + "GraphEditor");
- string $conn = ($blendName + "FromClipEditor");
- string $title = ("Blend: " + $blendName);
-
- // If this window already exists, just show it. Otherwise,
- // return if a window should not be created.
- if (`window -exists $win`) {
- if ($updateOnly)
- selectionConnection -e -select $blendName $conn;
- else
- showWindow $win;
- return;
- }
- else if ($updateOnly)
- return;
-
- // Create a selection connection which is used to pass the curve
- // to the graph editor.
- if (!`selectionConnection -exists $conn`)
- selectionConnection $conn;
-
- // Create a graph editor inside a form.
- window -title $title $win;
- formLayout $form;
- animCurveEditor -mainListConnection $conn $ed;
- formLayout -edit
- -attachForm $ed "left" 0
- -attachForm $ed "right" 0
- -attachForm $ed "bottom" 0
- -attachForm $ed "top" 0
- $form;
- showWindow $win;
-
- // Give the blend curve to the editor via the selection connection.
- selectionConnection -e -select $blendName $conn;
- }
-